#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;

const ll N = 1e6 + 10, INF = 0x3f3f3f3f;

void solve()
{
    ll n, m; cin >> n >> m;
    vector<vector<ll>> s(n + 5, vector<ll>(m + 5, 0));

    auto add = [&](ll x1, ll y1, ll x2, ll y2, ll d) -> void {
        // cout << x1 << ' ' << y1 << ' ' << x2 << ' ' << y2 << '\n';
        s[x1][y1] += d;
        s[x1][y2 + 1] -= d;
        s[x2 + 1][y1] -= d;
        s[x2 + 1][y2 + 1] += d;
        };

    for (ll i = 1;i <= min(n, m);i++)
        for (ll j = 0;j + i <= min(n, m);j++) {
            // cout << "i = " << i << ",j = " << j << "\n";
            add(0, j, n - i - j, m - i, 1);
            add(i, 0, n - j, m - i - j, 1);
            add(i + j, i, n, m - j, 1);
            add(j, i + j, n - i, m, 1);
        }

    for (ll i = 0;i <= n;i++) {
        for (ll j = 0;j <= m;j++) {
            if (i) s[i][j] += s[i - 1][j];
            if (j) s[i][j] += s[i][j - 1];
            if (i && j) s[i][j] -= s[i - 1][j - 1];
            cout << s[i][j] << ' ';
        }
        cout << '\n';
    }
}

signed main()
{
    //ios::sync_with_stdio(0);
    //cin.tie(0);cout.tie(0);
#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
    std::istringstream in(R"()");
    std::cin.rdbuf(in.rdbuf());
#endif
    ll T = 1;
    //cin>>T;
    for (ll i = 1;i <= T;i++) {
        solve();
    }
}
